﻿@{
    ViewBag.Title = "Edit";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
    var lstGroupTypes = new SelectList(ViewBag.GroupTypes, "Id", "Name");
}
@model TamoCRM.Web.Mvc.Areas.Admin.Models.Users.CreateUserModel

<div class="breadcrumbs" id="breadcrumbs">
    <script type="text/javascript">
        try {
            ace.settings.check('breadcrumbs', 'fixed'); } catch (e) { }
    </script>

    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="/Home">Trang chủ</a>
        </li>

        <li>
            <a href="javascript:void(0);">Danh mục</a>
        </li>
        <li class="active">Người dùng</li>
    </ul>
</div>

<div class="page-content">
    <div class="page-header">
        <h1>Tạo người dùng mới</h1>
    </div>
    <!-- /.page-header -->
@using (Html.BeginForm("Create", "User"))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    <div class="row">
        <div class="col-xs-12">
            <div id="user-profile-1" class="user-profile row">
                <div class="col-xs-12 col-sm-3 center">
                    <div>
                        @*<span class="profile-picture">
                            <img id="avatar" class="editable img-responsive editable-click editable-empty" alt="Alex's Avatar" src="/Images/avatars/profile-pic.jpg" />
                        </span>

                        <div class="space-4"></div>*@

                        <div class="width-80 label label-info label-xlg arrowed-in arrowed-in-right">
                            <div class="inline position-relative">
                                <a href="#" class="user-title-label dropdown-toggle" data-toggle="dropdown">
                                    <i class="icon-circle light-green middle"></i>
                                    &nbsp;
                                    <span class="white"></span>
                                </a>

                                <ul class="align-left dropdown-menu dropdown-caret dropdown-lighter">
                                    <li class="dropdown-header">Change Status </li>

                                    <li>
                                        <a href="#">
                                            <i class="icon-circle green"></i>
                                            &nbsp;
                                            <span class="green">Available</span>
                                        </a>
                                    </li>

                                    <li>
                                        <a href="#">
                                            <i class="icon-circle red"></i>
                                            &nbsp;
                                            <span class="red">Busy</span>
                                        </a>
                                    </li>

                                    <li>
                                        <a href="#">
                                            <i class="icon-circle grey"></i>
                                            &nbsp;
                                            <span class="grey">Invisible</span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-xs-12 col-sm-9">
                    <div class="profile-user-info profile-user-info-striped">
                        <div class="profile-info-row">
                            @ViewBag.Message
                            </div>
                            <div class="profile-info-row">
                                <div class="profile-info-name">Tên đăng nhập </div>

                                <div class="profile-info-value">
                                    @Html.TextBoxFor(x => x.Username)
                                    @Html.ValidationMessageFor(x => x.Username)
                                </div>
                            </div>

                            <div class="profile-info-row">
                                <div class="profile-info-name">Mật khẩu</div>
                                <div class="profile-info-value">
                                    @Html.PasswordFor(x => x.Password)
                                    @Html.ValidationMessageFor(x => x.Password)
                                </div>
                            </div>
                            <div class="profile-info-row">
                                <div class="profile-info-name">Xác nhận mật khẩu</div>
                                <div class="profile-info-value">
                                    @Html.PasswordFor(x => x.ConfirmPassword)
                                    @Html.ValidationMessageFor(x => x.ConfirmPassword)
                                </div>
                            </div>
                            <div class="profile-info-row">
                                <div class="profile-info-name">Họ và tên </div>

                                <div class="profile-info-value">
                                    @Html.TextBoxFor(x => x.FullName)
                                
                                </div>
                            </div>

                            <div class="profile-info-row">
                                <div class="profile-info-name">Email </div>

                                <div class="profile-info-value">
                                    @Html.TextBoxFor(x => x.Email)
                                    @Html.ValidationMessageFor(x => x.Email)
                                </div>
                            </div>

                            <div class="profile-info-row">
                                <div class="profile-info-name">Di động</div>

                                <div class="profile-info-value">
                                    @Html.TextBoxFor(x => x.Mobile)
                                </div>
                            </div>
                            <div class="profile-info-row">
                                <div class="profile-info-name">Station</div>

                                <div class="profile-info-value">
                                    @Html.TextBoxFor(x => x.StationId)
                                </div>
                            </div>
                            <div class="profile-info-row">
                                <div class="profile-info-name">Thông tin thêm</div>

                                <div class="profile-info-value">
                                    @Html.TextAreaFor(x => x.Description,new {@class="autosize-transition form-control"})
                                </div>
                            </div>
                        </div>

                    <div class="space-20"></div>

                    <div class="widget-box transparent">
                        <div class="widget-header widget-header-small">
                            <h4 class="blue smaller">
                                <i class="icon-rss orange"></i>
                                Vai trò
                            </h4>
                        </div>

                        <div class="widget-body">
                            <div class="widget-main padding-8">
                                @Html.CheckBoxListFor(x=>x.PostedRole.RoleID,x=>x.AllRole,role=>role.RoleID,role=>role.Name,x=>x.SelectedRole)
                                 
                                
                            </div>
                        </div>
                    </div>
                    <div class="widget-box transparent">
                        <div class="widget-header widget-header-small">
                            <h4 class="blue smaller">
                                <i class="icon-rss orange"></i>
                                Chi nhánh
                            </h4>
                        </div>

                        <div class="widget-body">
                            <div class="widget-main padding-8">
                                @Html.CheckBoxListFor(x=>x.PostedBranch.BranchId,x=>x.AllBranch,branch=>branch.BranchId,branch=>branch.Name,x=>x.SelectedBranch)
                                
                                
                            </div>
                        </div>
                    </div>
                    <div class="widget-box transparent">
                            <div class="widget-header widget-header-small">
                                <h4 class="blue smaller">
                                    <i class="icon-rss orange"></i>
                                    Nhóm TVTS
                                </h4>
                            </div>

                            <div class="widget-body">
                                <div class="widget-main padding-8">
                                    @Html.CheckBoxListFor(x => x.PostedGroup.GroupId, x => x.AllGroups, group => group.GroupId, group => group.Name, x => x.SelectedGroup)
                                </div>
                            </div>
                        </div>
                        <div class="widget-box transparent">
                            <div class="widget-header widget-header-small">
                                <h4 class="blue smaller">
                                    <i class="icon-rss orange"></i>
                                    Loại nhóm TVTS
                                </h4>
                            </div>

                            <div class="widget-body">
                                <div class="widget-main padding-8">
                                    @Html.DropDownListFor(x => x.GroupType, lstGroupTypes, new { @style = "width:150px;" })
                                </div>
                            </div>
                        </div>
                    <div class="center">
                        <input type="submit" class="btn btn-sm btn-primary" value="Save"/>
											</div>
                   
                </div>
            </div>
            

        </div>
        <!-- /.col -->
    </div>
}
    <!-- /.row -->
</div>
<script type="text/javascript">
    $(document).ready(function () {

        $('#frmEditUser').ajaxForm({
            beforeSend: function () {
                $("#spiner").html("<i class='icon-spinner icon-spin orange bigger-125'></i>Đang xử lý...");
            },
            complete: function (xhr) {
                $("#spiner").addClass("alert alert-block alert-success");
                $("#spiner").html("Cập nhật thành công.");
            }
        });
    });
</script>